<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker%summernote%news')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-文章管理')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('文章发布管理')"></div>
        <div th:replace="common/search::search('%add%newscategory')"></div>
        <!-- End Panel Basic -->
    </div>

    <!--添加News模态框-->
    <div id="modal-add-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <h3 class="m-t-none m-b">文章内容添加</h3>
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins">
                                <div class="ibox-content">
                                    <form id="aform" method="post" class="form-horizontal" action="add"
                                          onsubmit="return checkAdd()">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">标题*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" name="title"
                                                               required type="text" maxlength="200"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">类别*</label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" style="width: 100px;" name="cid">
                                                            <option value="-10" th:if="${about==0}">关于我们</option>
                                                            <option value="-20" th:if="${team==0}">团队介绍</option>
                                                            <option th:each="c:${nlist}" th:value="${c.id}"
                                                                    th:text="${c.name}"></option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">启用状态*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="state"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否置顶*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" class="js-switch" name="isTop"
                                                               value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">文章视频</label>
                                                    <div class="col-sm-10">
                                                        <input id="mfilevurl" name="mfile" type="file" class="file"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12 control-label">点击下方图标编辑图文信息
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row"
                                             style="display: flex;justify-content: center;align-items: center;flex-direction: column"
                                             id="arowhead">

                                        </div>
                                        <!--<div class="row">-->
                                        <!--<div class="col-md-12">-->
                                        <!--<div class="form-group">-->
                                        <!--<label class="col-sm-2 control-label">文章缩略图*-->
                                        <!--</label>-->
                                        <!--<div class="col-sm-10">-->
                                        <!--<input id="picmfile" name="mfile" type="file" class="file"/>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <div class="form-group">
                                            <div class="col-sm-4 col-sm-offset-2">
                                                <button class="btn btn-primary" type="submit">保存内容</button>
                                                <button data-toggle="modal" type="button" class="btn btn-white"
                                                        href="#modal-add-form">取消
                                                </button>
                                            </div>
                                        </div>
                                        <input id="apic" name="pic" type="hidden" value="" required="required"/>
                                        <input id="ainfo" name="info" type="hidden" value="" required="required"/>
                                        <input id="hidphotos" name="photos" type="hidden" value="" required="required"/>
                                        <input id="hidvurl" name="vurl" type="hidden" value=""/>
                                        <input name="state" type="hidden" value="1"/>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--修改News模态框-->
    <div id="modal-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <h3 class="m-t-none m-b">文章内容修改</h3>
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins">
                                <div class="ibox-content">
                                    <form id="mform" method="post" class="form-horizontal" action="modify"
                                          onsubmit="return checkModify()">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">标题*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input class="form-control" id="title" name="title"
                                                               required
                                                               type="text" maxlength="200"/>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">类别*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <select class="form-control" style="width: 100px;" id="cid"
                                                                name="cid">
                                                            <option value="-10">关于我们</option>
                                                            <option value="-20">团队介绍</option>
                                                            <option th:each="c:${nlist}"
                                                                    th:value="${c.id}" th:text="${c.name}"></option>
                                                        </select>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label">文章视频</label>
                                                    <div class="col-sm-10">
                                                        <input id="mfilevurl2" name="mfile" type="file" class="file"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">启用状态*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="state" name="state" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group">
                                                    <label class="col-sm-4 control-label">是否置顶*
                                                    </label>
                                                    <div class="col-sm-8">
                                                        <input type="checkbox" id="isTop" name="isTop" value="-1">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-12">
                                                <div class="form-group">
                                                    <div class="col-sm-12 control-label">点击下方图标编辑图文信息
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row"
                                             style="display: flex;justify-content: center;align-items: center;flex-direction: column"
                                             id="mrowhead">

                                        </div>
                                        <!--<div class="row">-->
                                        <!--<div class="col-md-12">-->
                                        <!--<div class="form-group">-->
                                        <!--<label class="col-sm-2 control-label">文章缩略图*-->
                                        <!--</label>-->
                                        <!--<div class="col-sm-10">-->
                                        <!--<input id="picmfile2" name="mfile" type="file" class="file"/>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--<div class="row">-->
                                        <!--<div class="col-md-12">-->
                                        <!--<div class="form-group">-->
                                        <!--<label class="col-sm-2 control-label">文章内容*</label>-->
                                        <!--<div class="col-sm-10">-->
                                        <!--<textarea class="form-control" id="info"  name="info"></textarea>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--<div class="row">-->
                                        <!--<div class="col-md-12">-->
                                        <!--<div class="form-group">-->
                                        <!--<label class="col-sm-2 control-label">引用图像*-->
                                        <!--</label>-->
                                        <!--<div class="col-sm-10">-->
                                        <!--<input id="photosmfile2" name="mfile" type="file" class="file"/>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->
                                        <!--</div>-->

                                        <div class="form-group">
                                            <div class="col-sm-4 col-sm-offset-2">
                                                <button class="btn btn-primary" type="submit">保存内容</button>
                                                <button data-toggle="modal" type="button" class="btn btn-white"
                                                        href="#modal-form">取消
                                                </button>
                                            </div>
                                        </div>
                                        <input id="mpic" name="pic" type="hidden" value="" required="required"/>
                                        <input id="minfo" name="info" type="hidden" value="" required="required"/>
                                        <input id="hidvurl2" name="vurl" type="hidden" value=""/>
                                        <input id="id" name="id" type="hidden" value=""/>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="pic-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">编辑图片</label>
                                <div class="col-sm-10">
                                    <input id="picmfile" name="mfile" type="file" class="file"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="button" onclick="savepic()">保存</button>
                            <button data-toggle="modal" type="button" class="btn btn-white" href="#pic-form">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="txt-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">编辑内容</label>
                                <div class="col-sm-10">
                                    <textarea class="form-control" id="info" name="info" rows="20"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 20px">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="button" onclick="savewz()">保存内容</button>
                            <button data-toggle="modal" type="button" class="btn btn-white" href="#txt-form">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--设置商品服务关联商家-->
    <div id="guanlianSP-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-body">
                    <form method="post" class="form-horizontal" action="guanlianSP">
                        <div class="row">
                            <div class="col-md-8">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label">文章关联商品</label>
                                    <div class="col-sm-8">
                                        <select class="form-control select2" id="gid" name="gid">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4"></div>
                        </div>
                        <div class="row" style="margin-top: 20px">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="button" onclick="guanlianSJSave()">保存内容</button>
                                <button data-toggle="modal" type="button" class="btn btn-white" href="#guanlianSP-form">
                                    取消
                                </button>
                                <input id="hidid" name="id" type="hidden" value=""/>
                                <input id="hidsid" name="sid" type="hidden" value=""/>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/news.js"></script>

<script th:inline="javascript">
    /*<![CDATA[*/
    var __config__ = {

        // 'userName': [[${user?.xxName}]]
    }
    /*]]>*/

</script>
</body>
</html>
